testsuite: Add a broken test
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Mar 2019 05:47:36 +0000 (06:47 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 5 May 2019 05:18:39 +0000 (07:18 +0200)
This also adds some build magic so all tests that contain "-3d" in them
won't be added to the Cairo renderer.

Of course, this new test is such a test.

testsuite/gsk/compare/clip-coordinates-3d.node [new file with mode: 0644]
testsuite/gsk/compare/clip-coordinates-3d.png [new file with mode: 0644]
testsuite/gsk/meson.build

diff --git a/testsuite/gsk/compare/clip-coordinates-3d.node b/testsuite/gsk/compare/clip-coordinates-3d.node
new file mode 100644 (file)
index 0000000..6b417ef
--- /dev/null
@@ -0,0 +1,19 @@
+transform {
+  /* adding the perspective line here turns the matrix from a 2D
+     category into a 3D category. It does not have any visual effect. */
+  transform: perspective(200) scale(2);
+  child: container {
+    color {
+      bounds: 0 0 50 50;
+      color: transparent;
+    }
+
+    clip {
+      clip: 10 10 30 30;
+      child: color {
+        bounds: 0 0 50 50;
+        color: red;
+      }
+    }
+  }
+}
diff --git a/testsuite/gsk/compare/clip-coordinates-3d.png b/testsuite/gsk/compare/clip-coordinates-3d.png
new file mode 100644 (file)
index 0000000..1da0014
Binary files /dev/null and b/testsuite/gsk/compare/clip-coordinates-3d.png differ
index e9fd91376448d3eb8f8e7c442daf5aa0fcce4e3c..df863a8fad91cf0e49bb3842ef07b0d2ecf3d1e8 100644 (file)
@@ -66,6 +66,7 @@ foreach gl_test : gl_tests
 endforeach
 
 compare_render_tests = [
+  'clip-coordinates-3d',
   'clipped_rounded_clip',
   'opacity_clip',
   'outset_shadow_offset_both',
@@ -76,24 +77,27 @@ compare_render_tests = [
 ]
 
 renderers = [
-  'opengl',
-  'cairo',
+  # name      exclude term
+  [ 'opengl', ''    ],
+  [ 'cairo',  '-3d' ],
 ]
 
 foreach renderer : renderers
   foreach test : compare_render_tests
-    test(renderer + ' ' + test, compare_render,
-         args: [join_paths(meson.current_source_dir(), 'compare', test + '.node'),
-                join_paths(meson.current_source_dir(), 'compare', test + '.png')],
-         env: [ 'GIO_USE_VOLUME_MONITOR=unix',
-                'GSETTINGS_BACKEND=memory',
-                'GTK_CSD=1',
-                'G_ENABLE_DIAGNOSTIC=0',
-                'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
-                'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
-                'GSK_RENDERER=' + renderer
-              ],
-       suite: [ 'gsk', 'gsk-compare', 'gsk-' + renderer, 'gsk-compare-' + renderer ])
+    if (renderer[1] == '' or not test.contains(renderer[1]))
+      test(renderer[0] + ' ' + test, compare_render,
+           args: [join_paths(meson.current_source_dir(), 'compare', test + '.node'),
+                  join_paths(meson.current_source_dir(), 'compare', test + '.png')],
+           env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+                  'GSETTINGS_BACKEND=memory',
+                  'GTK_CSD=1',
+                  'G_ENABLE_DIAGNOSTIC=0',
+                  'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+                  'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+                  'GSK_RENDERER=' + renderer[0]
+                ],
+         suite: [ 'gsk', 'gsk-compare', 'gsk-' + renderer[0], 'gsk-compare-' + renderer[0] ])
+    endif
   endforeach
 endforeach